<template>
	<view class="data-item" style="padding-bottom: 20rpx;position: relative;">
		<view class="order-type">
			<view>{{value.customer_user}}</view>
			<!-- <view style="color: #333333;">已看房<text style=" margin: 0 10rpx; color: #2C72FF;">{{value.company_look_num || '0'}}</text>次</view> -->
		</view>
		<view class="flag">
			<view class="sj" :style="{'border-right-color': getColor(1)}"></view>
			<view class="label" :style="{'color': getColor(0), 'background-color': getColor(1)}">{{status[value.customer_status]}}</view>
		</view>
		<view class="order-info" style="margin-bottom: 0;position: relative;">
			<view class="info-item"><view class="key">联系电话：</view>{{value.customer_phone}}</view>
			<view class="info-item" style="margin-right: 150rpx;"><view class="key">单位名称：</view>{{value.company_name}}</view>

			<!-- <view class="info-item"><view class="key">预约次数：</view>{{value.company_look_num || '0'}}</view> -->
		</view>
	</view>
</template>

<script>
const LABELCOLOR = {
	'10': ['#2C72FF', '#EEF4FF'],
	'20': ['#2C72FF', '#EEF4FF'],
	'30': ['#333333', '#EDEEEF'],
	'40': ['#2C72FF', '#EEF4FF'],
	'50': ['#333333', '#EDEEEF'],
	'60': ['#2C72FF', '#EEF4FF'],
	'70': ['#FF732C', '#FFF5EE'],
	'80': ['#FF732C', '#FFF5EE'],
	'90': ['#FF732C', '#FFF5EE'],
	'100': ['#FF732C', '#FFF5EE'],
	'110': ['#333333', '#EDEEEF'],
}
export default {
	name: 'CustomerInfo',
	props:{
		value: {
			type: Object,
			default: ()=>{
				return {}
			}
		},
		status: {
			type: Object,
			default: ()=>{
				return {}
			}
		}
	},
	data(){
		return {
		}
	},
	created(){
	},
	methods:{
		getColor(index){
			if(LABELCOLOR[this.value.customer_status]){
				return LABELCOLOR[this.value.customer_status][index]
			}else{
				return ['#2C72FF', '#EEF4FF'][index]
			}
		}
	}
}
</script>

<style lang="scss" scoped>
.data-item{
	// display: flex;
	// margin-bottom: 30rpx;
	.order-type{
		display: flex;
		justify-content: space-between;
		font-size: 28rpx;
		color: #999999;
		>view:first-child{
			font-size: 32rpx;
			font-weight: bolder;
			color: #333333;
		}
	}
	.order-info{
		margin: 30rpx 0;
		.info-item{
			display: flex;
			font-size: 28rpx;
			color: #333333;
			line-height: 50rpx;
			.key{
				min-width: 150rpx;
				font-size: 28rpx;
				color: #999999;
			}
			.info-imgs{
				display: flex;
				flex-wrap: wrap;
				.img-item{
					width: 120rpx;
					height: 120rpx;
					margin: 2rpx 2rpx 0 0;
				}
			}
		}
	}
	.handle-btn{
		border-top: 1px solid #F5F5F5;
		height: 95rpx;
		margin-top: 20rpx;
		display: flex;
		> view{
			height: 95rpx;
			display: flex;
			justify-content: center;
			align-items: center;
			font-size: 32rpx;
			font-weight: bolder;
			color: #333333;
			flex: 1;
		}
		& :last-child{
			color: #0055FE;
		}
	}
	.target-info{
		flex: 1;
		display: flex;
		padding-bottom: 20rpx;
		.img{
			width: 260rpx;
			height: 295rpx;
			border-radius: 10rpx;
			margin-right: 20rpx;
		}
		.top{
			.name{
				font-size: 28rpx;
				font-weight: bolder;
				color: #333333;
			}
			.desc{
				font-size: 28rpx;
				color: #999999;
				margin-top: 10rpx;
			}
		}
		.fee{
			display: flex;
			align-items: center;
			justify-content: space-between;
			margin-top: 30rpx;
			.amount{
				font-size: 36rpx;
				color: #FF3737;
			}
			.common-btn{
				height: 60rpx;
				width: 160rpx;
				font-size: 28rpx;
				margin: 0;
			}
		}
	}
}

.flag{
	height: 50rpx;
	font-size: 24rpx;
	font-weight: 400;
	position: absolute;
	right: -20rpx;
	top: 0;
	display: flex;
	align-items: center;
	.sj{
		height: 50rpx;
		width: 20rpx;
		box-sizing: border-box;
		border-right: 10rpx solid #EEF4FF;
		border-left: 10rpx solid #FFFFFF;
		border-top: 25rpx solid #FFFFFF;
		border-bottom: 25rpx solid #FFFFFF;
	}
	.label{
		color: #2C72FF;
		background-color: #EEF4FF;
		display: flex;
		align-items: center;
		height: 50rpx;
		padding: 0 10rpx;
	}
}
</style>
